# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

_realname=mpc

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.2
pkgrel=2
pkgdesc="Multiple precision complex arithmetic library (mingw-w64)"
groups=("${MINGW_PACKAGE_PREFIX}")
url='http://www.multiprecision.org'
license=('LGPL')
arch=('any')
depends=("${MINGW_PACKAGE_PREFIX}-mpfr")
makedepends=("${MINGW_PACKAGE_PREFIX}-gmp>=5.0" "${MINGW_PACKAGE_PREFIX}-mpfr")
options=('staticlibs' '!emptydirs')
source=("http://www.multiprecision.org/mpc/download/${_realname}-${pkgver}.tar.gz")
sha1sums=('5072d82ab50ec36cc8c0e320b5c377adb48abe70')

build() {
  mkdir -p ${srcdir}/build-${MINGW_CHOST}
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../${_realname}-${pkgver}/configure --build=${MINGW_CHOST} \
    --prefix=${MINGW_PREFIX} \
    --enable-static \
    --disable-shared \
    --with-gmp=${MINGW_PREFIX} \
    --with-mpfr=${MINGW_PREFIX}
  make
}

check() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make check
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" install
}
